package org.vue.table;

import javax.swing.table.AbstractTableModel;

public class TableModel extends AbstractTableModel {

	private static final long serialVersionUID = 1L;
	private Object[] head;
	private String[][] data;

	public TableModel(Object[] head, String[][] data){
		this.head = head;
		this.data = data;
	}

	@Override
	public int getColumnCount() {
		return head.length;
	}

	@Override
	public int getRowCount() {
		return data.length;
	}

	@Override
	public Object getValueAt(int x, int y) {
		return data[x][y];
	}
	
	public boolean isCellEditable(int x, int y){
		return false;
	}
	
	public String getColumnName(int x){
		return head[x].toString();
	}

}
